<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="s" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div class="container-breadcrumb">
    <div class="row ">
        <div class="col-sm-12">
            <ol class="breadcrumb">
                <li><a href="#"><span class="glyphicon glyphicon-home"></span></a></li>
                <li class="active"><s:message text="会员统计"/></li>
            </ol>
        </div>
    </div><!--/.row-->
</div>

<div id="container-content" class="container-content">
    <div class="panel panel-default report-container">
        <div class="panel-heading">
            <div class="col-md-2">会员提现记录</div>
        </div>
        <div class="panel-body">
        <form:form action="${pageContext.request.contextPath}/customer/customerWithdrawLog" modelAttribute="customerAttribute" method="get"
                   cssClass="row products-condition" id="myForm">
            <div class="form-inline col-sm-12">
                <div class="form-group">
                    <label>会员ID</label>
                    <form:input id="id" path="id" cssClass="form-control"/>
                </div>
                <div class="form-group">
                    <label>账户名称</label>
                    <form:input id="nick" path="account" cssClass="form-control"/>
                </div>
            <label>提现时间</label>
            <div class="form-group">
                <div id="datetimepicker_start" class="input-group date">
                    <form:input id="startTimeDate" cssClass="form-control" path="startTime" data-date-format="YYYY-MM-DD"/>
                    <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                </div>
            </div>
            至
            <div class="form-group">
                <div id="datetimepicker_end" class="input-group date">
                    <form:input id="endTimeDate" cssClass="form-control" path="endTime" data-date-format="YYYY-MM-DD"/>
                    <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                </div>
            </div>
            <div class="form-group">
                <button id="btn_search" type="button" class="btn btn-default">查询</button>
            </div>
          </div>
            <form:hidden path="type" id="type" />
            <form:hidden path="currentPage" id="currentPage"/>
            <form:hidden path="pageSize" id="pageSize"/>
            <input id="total" type="hidden" value="${dataList.totalCount}"/>
        </form:form>
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th >会员ID</th>
                    <th>
                        <c:if test="${type==1}">支付宝账户</c:if>
                        <c:if test="${type==2}">微信openID</c:if>
                        <c:if test="${type==3}">充值手机号码</c:if>
                    </th>
                    <th>操作金额</th>
                    <th>三方流水号</th>
                    <th>提现时间</th>
                    <th >平台流水号</th>
                    <th style="min-width: 50px;">状态</th>
                    <th>失败原因</th>
                    <th>提现类型</th>
                </tr>
                </thead>
                <tbody id="myTable">
                <c:forEach items="${dataList.data}" var="data">
                    <tr>
                        <td>${data.customer.id}</td>
                        <td>${data.account}</td>
                        <td>${data.amount}</td>
                        <td>${data.channelOrderNo}</td>
                        <td><fmt:formatDate value="${data.dateCreated}" pattern="yyyy-MM-dd HH:mm"/></td>
                        <td>${data.orderNo}</td>
                        <td>
                            <c:if test="${data.status==1}"><span style="color: #00cf00">成功</span></c:if>
                            <c:if test="${data.status==0}"><span style="color: red">失败</span></c:if>
                            <c:if test="${data.status==-1}"><span style="color: blue">充值中...</span></c:if>
                        </td>
                        <td>
                            <c:if test="${data.status==1}">成功</c:if>
                            <c:if test="${data.status==0}">${data.errorDesc}</c:if>
                        </td>
                        <td>${data.type==1?"兑换集分宝":data.type==2?"微信钱包提现":data.type==3?"手机话费充值":""}</td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
            <div class="row">
                <div id="paginationInfo" class="col-md-4 pagination-info"></div>
                <div id="pagination" class="col-md-8"></div>
            </div>
        </div>
    </div>
</div>

<script src="${pageContext.request.contextPath}/resources/common/js/bootstrap-paginator.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/common/paginator.js"></script>

<script>
    $(document).ready(function () {
        $('#datetimepicker_start').datetimepicker({
            minView: "month", //选择日期后，不会再跳转去选择时分秒
            format: "yyyy-mm-dd", //选择日期后，文本框显示的日期格式
            language: 'zh', //汉化
            pickTime: false,
            autoclose: true
        });
        $('#datetimepicker_end').datetimepicker({
            minView: "month", //选择日期后，不会再跳转去选择时分秒
            format: "yyyy-mm-dd", //选择日期后，文本框显示的日期格式
            language: 'zh', //汉化
            pickTime: false,
            autoclose: true
        });

        $("#btn_search").click(function(){
            $("#currentPage").val("1");
            $("#myForm").submit();
        });

    });
</script>

